



/**
 * User domain class.
 */
class User {
	static transients = ['pass']
	static hasMany = [authorities: Role]
	static belongsTo = Role

	/** Username */
	String username
 
	/** MD5 Password */
	String passwd = '123456'
	/** enabled */
	boolean enabled
 
	/** plain password to create a MD5 password */
	String pass = '[secret]'


	static constraints = {
		username(blank: false,size: 1..100, unique: true)
 		passwd(blank: false)
		enabled()
	}

    static mapping = {
        tablePerHierarchy false
  
        //authorities sort : 'id' , order : 'asc' 
    }

}
